package com.qust.securityapi.threadLocal;

import com.qust.securityapi.eneity.Auth;
import lombok.NoArgsConstructor;

/**
 * @author Frank KONG
 * @version 1.0
 * @date 2021/11/22 19:33
 */
@NoArgsConstructor
public class AuthThreadLocal {

    private static ThreadLocal<Auth> local = new ThreadLocal<>();

    public static Auth getAuth(){
        return local.get();
    }

    public static void setAuth(Auth auth){
        local.set(auth);
    }

    public static void clearAuth(){
        local.remove();
    }

}
